﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.Security;

namespace Mocola.Common
{
    /// <summary>
    /// 系统User静态调用类
    /// </summary>
    public static class MocolaUser
    {
        public static CustomIdentity CurrentUser
        {
            get
            {
                Page p = (Page)HttpContext.Current.Handler;

                if (p.Request.IsAuthenticated)
                {
                    CustomIdentity identity = p.User.Identity as CustomIdentity;

                    if (identity != null)
                    {
                        return identity;
                    }
                }

                return null;
            }
        }
    }
}
